﻿using System;
using System.Collections.Generic;
using System.Text;

namespace CharacterTrailLibrary.CustomModels
{
    public class ProductItemModel
    {
        public const string CheckStateYes = "已审核";
        public const string CheckStateNo = "未审核";
        public ProductItemModel()
        {
            this.IsLeafNode = false;
            ModelKey = Guid.NewGuid().ToString();
            ImageIndex = 0;
            CheckStateDesc = string.Empty;
        }

        public string CheckStateDesc { get; set; }

        public int ImageIndex { get; set; }

        public string ModelKey { get; private set; }

        #region 字段
        private Int32 _productItemId;
        private String _productItemNumber;
        private String _productItemName;
        private String _productVersion;

        private Int32 _idx;
        private Decimal _qty;

        private String _procedureNo;
        private String _procedureName;

        private String _parentProductVersion;
        private String _parentProductItemNumber;

        #endregion

        #region 属性

        public bool IsLeafNode { get; set; }

        public string ProductItemNameVersion
        {
            get
            {
                return _productItemName + @"[版本:" + ProductVersion + @"]";
            }
        }

        private string _parentProductId = string.Empty;
        public string ParentProductId
        {
            get { return _parentProductId; }
            set { this._parentProductId = value; }
        }

        public string ProductItemNumberAndVersion
        {
            get
            {
                return ProductItemNumber ;
            }
        }

        /// <summary>
        ///
        /// </summary>
        public Int32 ProductItemId
        {
            get { return _productItemId; }
            set { _productItemId = value; }
        }
        /// <summary>
        ///
        /// </summary>
        public String ProductItemNumber
        {
            get { return _productItemNumber; }
            set { _productItemNumber = value; }
        }
        /// <summary>
        ///
        /// </summary>
        public String ProductItemName
        {
            get { return _productItemName; }
            set { _productItemName = value; }
        }
        /// <summary>
        ///
        /// </summary>
        public String ProductVersion
        {
            get { return _productVersion; }
            set { _productVersion = value; }
        }
        /// <summary>
        ///
        /// </summary>
        public Int32 Idx
        {
            get { return _idx; }
            set { _idx = value; }
        }
     
        /// <summary>
        ///
        /// </summary>
        public Decimal Qty
        {
            get { return _qty; }
            set { _qty = value; }
        }
        /// <summary>
        ///
        /// </summary>
        public String ProcedureNo
        {
            get { return _procedureNo; }
            set { _procedureNo = value; }
        }
        /// <summary>
        ///
        /// </summary>
        public String ProcedureName
        {
            get { return _procedureName; }
            set { _procedureName = value; }
        }
        /// <summary>
        ///
        /// </summary>
        public String ProductItemNumberVersion
        {
            get
            {
                //return this.ProductItemNumber + "+" + ProductVersion;
                //return  this.ProductItemNumber + "+" + ProductVersion;
                return ModelKey;
            }
        }

        /// <summary>
        ///
        /// </summary>
        public String ParentProductItemNumberVersion
        {
            get { return this.ParentProductItemNumber + "+" + ParentProductVersion; }
        }

        /// <summary>
        ///
        /// </summary>
        public String ParentProductVersion
        {
            get { return _parentProductVersion; }
            set { _parentProductVersion = value; }
        }

        /// <summary>
        ///
        /// </summary>
        public String ParentProductItemNumber
        {
            get { return _parentProductItemNumber; }
            set { _parentProductItemNumber = value; }
        }
        #endregion
    }
}
